#include <stdio.h>
typedef unsigned int uint32_t;
void tran_10_16(uint32_t num)
{
	uint32_t r = num % 16;
	if (num >= 16)
	{
		tran_10_16(num / 16);
		if (r >= 10)
		{
			switch (r)
			{
			case 10:putchar('A'); break;
			case 11:putchar('B'); break;
			case 12:putchar('C'); break;
			case 13:putchar('D'); break;
			case 14:putchar('E'); break;
			case 15:putchar('F'); break;
			}
		}
		else
		{
			printf("%d", r);
		}
	}
	else
	{
		if (num >= 10)
		{
			switch (num)
			{
			case 10:putchar('A'); break;
			case 11:putchar('B'); break;
			case 12:putchar('C'); break;
			case 13:putchar('D'); break;
			case 14:putchar('E'); break;
			case 15:putchar('F'); break;
			}
		}
		else
			printf("%d", num);
	}
	return;
}
int main()
{
	uint32_t x;
	scanf_s("%d", &x);
	tran_10_16(x);
	return 0;
}